//
//  LCHomeVedioTableViewCell.m
//  段子手
//
//  Created by dllo on 16/3/22.
//  Copyright © 2016年 JokesTeam. All rights reserved.
//

#import "LCHomeVedioTableViewCell.h"
#import <MediaPlayer/MediaPlayer.h>

@interface LCHomeVedioTableViewCell ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, retain) UIImageView *imgVUser;
@property (nonatomic, retain) UILabel *labelUserName;
@property (nonatomic, retain) UILabel *labelText;
@property (nonatomic, retain) UIButton *buttonKind;
@property (nonatomic, retain) UIButton *buttonZan;
@property (nonatomic, retain) UILabel *labelZan;
@property (nonatomic, retain) UIButton *buttonLow;
@property (nonatomic, retain) UILabel *labelLow;
@property (nonatomic, retain) UIButton *buttonHot;
@property (nonatomic, retain) UILabel *labelHot;

@property (nonatomic, retain) UITableView *tableViewComment;

@property (nonatomic, assign) CGRect rectText;
@property (nonatomic, assign) CGRect rectButton;

@property (nonatomic, assign)CGRect rectCommentText;

@property (nonatomic, assign)CGFloat tableViewCommentH;


@property (nonatomic, retain) MyVedioPlayer *myVedioPlayer;

@property (nonatomic, assign) CGRect rectVedio;

@property (nonatomic, retain) UIImageView *imageVMedia;


@property (nonatomic, retain) UIButton *playButton;

@property (nonatomic, retain) UIView *bottomView;

@property (nonatomic, retain) UILabel *playTimesLabel;

@property (nonatomic, retain) UIButton *buttonFullScreen;

@property (nonatomic, retain) UILabel *timeRightLabel;


@end

@implementation LCHomeVedioTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}


- (void)setModel:(LCHomeTableViewPassageModel *)model{
    
    _model = model;
    
    [self setModelValue];
    
    //    [_tableViewComment reloadData];
    //    [self reloadInputViews];
    
    
}


#pragma mark - 用model给控件赋值
- (void)setModelValue{
    
    //    获取评论tableView的自适应高度
    self.tableViewCommentH = 0;
    
    if (_model.comments.count != 0) {
        
        for (int i = 0; i < _model.comments.count; i++) {
            NSDictionary *arr  = [NSDictionary dictionaryWithDictionary:_model.comments[i]];
            NSString *str = arr[@"text"];
            CGRect rect = [WxlAPPTools scripeSuitWidthWithString:str Font:13 Size:CGSizeMake(SCREENW - 20 - 60, 0)];
            _tableViewCommentH += rect.size.height + 50;
            
        }
    }
    
    
    //    解决播放器的重用问题
    if (_myVedioPlayer) {
        [_myVedioPlayer.playView removeFromSuperview];
    }
    
    
    //    获取段子内容的自适应高度
    self.rectText = [WxlAPPTools scripeSuitWidthWithString:_model.text Font:14 Size:CGSizeMake(SCREENW - 40, 0)];
    
    
//    NSLog(@"%@", _model.category_name);
    self.rectButton = [WxlAPPTools scripeSuitWidthWithString:_model.category_name Font:10 Size:CGSizeMake(0, 20)];
    
    
    [_imgVUser sd_setImageWithURL:[NSURL URLWithString:_model.user[@"avatar_url"]]];
    
    _labelUserName.text = _model.user[@"name"];
    
    
    _labelText.text = _model.text;
     _labelText.frame = CGRectMake(20, _imgVUser.frame.size.height + _imgVUser.frame.origin.y + 15, SCREENW - 40, _rectText.size.height);
    
    
    [_buttonKind setTitle:_model.category_name forState:UIControlStateNormal];
     _buttonKind.frame = CGRectMake(20, _labelText.frame.origin.y + _labelText.frame.size.height + 15, _rectButton.size.width + 20, 20);
    

//   ====================================
    
         CGFloat vedioH = (SCREENW - 40) * [_model.origin_video[@"height"] floatValue] / [_model.origin_video[@"width"] floatValue];
        
       self.rectVedio = CGRectMake(20, _buttonKind.frame.origin.y + _buttonKind.frame.size.height + 10, SCREENW - 40, vedioH);
    
    _imageVMedia.frame = _rectVedio;
    
    
    
    NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:_model.url]];
    
            dispatch_async(dispatch_get_main_queue(), ^{
    UIImage *image = [UIImage imageWithWebPData:data];
    _imageVMedia.image = image;
            });
    
    _bottomView.frame = CGRectMake(20, _imageVMedia.frame.origin.y + _imageVMedia.frame.size.height - 35, _imageVMedia.frame.size.width, 35);
    
    _playTimesLabel.frame = CGRectMake(5, 5, _bottomView.frame.size.width * 0.6, 25);
      _playTimesLabel.text = [NSString stringWithFormat:@"%@次播放", _model.play_count];
    _timeRightLabel.text = [NSString stringWithFormat:@"%d%d:%d%d", (int)_model.durationV/600, (int)(_model.durationV/ 60) % 10, (int)((int)_model.durationV % 60)/10, (int)((int)_model.durationV % 60)%10];
      _buttonFullScreen.frame = CGRectMake(_bottomView.frame.size.width - 35, 0, 35, 35);
    
    _timeRightLabel.frame = CGRectMake( _buttonFullScreen.frame.origin.x - 50, 5, 50, 25);
    
    
    _playButton.frame = CGRectMake(_imageVMedia.frame.origin.x + (_imageVMedia.frame.size.width - 50)/2, _imageVMedia.frame.origin.y + (_imageVMedia.frame.size.height - 50)/2, 50, 50);
    
    
      [_myVedioPlayer.playView addSubview:_buttonFullScreen];
    
//    if (!_myVedioPlayer) {
//
//        
//        self.myVedioPlayer = [MyVedioPlayer shareVedioPlayer];
    
//        [_myVedioPlayer setPlayViewWithframe:rectVedio string:_model.origin_video[@"url_list"][0][@"url"]];
    
//        [self.contentView addSubview:_myVedioPlayer.playView];
//
//    }else{
//        
//        NSLog(@"~~~~~~~~~~~~~~~~~~~~~~~~~#########~~~~~~~~~~~~~~~~~~~~~~%@", _model.origin_video[@"url_list"][0][@"url"]);
////        NSString *str = _model.origin_video[@"url_list"][0][@"url"];
//        AVPlayerItem *pI = [[AVPlayerItem alloc]initWithURL:[NSURL URLWithString: _model.origin_video[@"url_list"][0][@"url"]]];
////        [AVPlayerItem playerItemWithURL:_model.origin_video[@"url_list"][0][@"url"]];
////        _myVedioPlayer.playerItem = pI;
//        [_myVedioPlayer.player replaceCurrentItemWithPlayerItem:pI];
//        _myVedioPlayer.playView.frame = rectVedio;
//        _myVedioPlayer.playerLayer.frame = CGRectMake(0, 0, rectVedio.size.width, rectVedio.size.height);
//        [_myVedioPlayer.playView.layer insertSublayer:_myVedioPlayer.playerLayer atIndex:0];
//
//        
//    }
//
//        self.myVedioPlayer = [MyVedioPlayer shareVedioPlayer];
//        
//        [_myVedioPlayer setPlayViewWithframe:rectVedio string:_model.origin_video[@"url_list"][0][@"url"]];
//        
//        [self.contentView addSubview:_myVedioPlayer.playView];

    
    
     _buttonZan.frame = CGRectMake(20, _imageVMedia.frame.size.height + _imageVMedia.frame.origin.y + 5, 30, 30);
 
    _labelZan.text = [NSString stringWithFormat:@"%@", _model.digg_count];
    _labelZan.frame = CGRectMake(_buttonZan.frame.origin.x + _buttonZan.frame.size.width, _buttonZan.frame.origin.y + 10, 45, 15);

     _buttonLow.frame = CGRectMake(_labelZan.frame.origin.x + _labelZan.frame.size.width + 4, _labelZan.frame.origin.y - 5, 30, 30);
    _labelLow.text = [NSString stringWithFormat:@"%@",_model.bury_count];
    _labelLow.frame = CGRectMake(_buttonLow.frame.origin.x
                                 + _buttonLow.frame.size.width, _buttonLow.frame.origin.y  + 5, 45, 15);
    

    _buttonHot.frame = CGRectMake(_labelLow.frame.origin.x + _labelLow.frame.size.width + 4, _labelLow.frame.origin.y - 6, 30, 30);
    _labelHot.text = [NSString stringWithFormat:@"%@", _model.comment_count];
    _labelHot.frame = CGRectMake(_buttonHot.frame.origin.x + _buttonHot.frame.size.width, _buttonHot.frame.origin.y + 6, 45, 15);
    
//解决评论tableView的重用问题
//    if (_tableViewComment) {
//        _tableViewComment.frame = CGRectMake(10, _buttonZan.frame.origin.y + _buttonZan.frame.size.height, SCREENW - 20, _tableViewCommentH);
//        
//    }
    
    
    if (self.tableViewComment) {
        [_tableViewComment removeFromSuperview];
    }
    
        //    如果评论数组不为空， 则创建评论tableView
        if (_model.comments.count != 0 ) {
    
            [self createTableViewComment];
    
        }
    
}



#pragma mark - 创建评论的tableView
- (void)createTableViewComment{
    
    if (self.tableViewComment) {
        [_tableViewComment removeFromSuperview];
    }
    
    self.tableViewComment = [[UITableView alloc]initWithFrame:CGRectMake(10, _buttonZan.frame.origin.y + _buttonZan.frame.size.height, SCREENW - 20, _tableViewCommentH) style:UITableViewStylePlain];
    
    _tableViewComment.bounces = NO;
    
    _tableViewComment.dataSource = self;
    _tableViewComment.delegate = self;
    
    [_tableViewComment registerClass:[LCContentTableViewCell class] forCellReuseIdentifier:@"commentCell"];
    //    _tableViewComment.backgroundColor = [UIColor colorWithRed:0.4 green:0.9 blue:0.4 alpha:1];
    
    //    self.tableViewCommentH = 0.0;
    
    [self.contentView addSubview:_tableViewComment];
    
    
}


#pragma mark - 评论tableView的协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LCContentTableViewCell *commentCell = [tableView dequeueReusableCellWithIdentifier:@"commentCell"];
    
    LCHomeCommentModel *modelC = [LCHomeCommentModel modelWithDic:_model.comments[indexPath.row]];
    
    //    NSLog(@"%@", modelC);
    
    commentCell.model = modelC;
    
    //    commentCell.backgroundColor = [UIColor colorWithRed:0.8 green:0.4 blue:0.4 alpha:0.1];
    
    
    return commentCell;
    
}



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (_model.comments.count > 2) {
        return 2;
    }else return _model.comments.count;
    
}



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSString *textStr = _model.comments[indexPath.row][@"text"];
    
    self.rectCommentText = [WxlAPPTools scripeSuitWidthWithString:textStr Font:13 Size:CGSizeMake(SCREENW - 80, 0)];
    
    NSLog(@"%f", 50 + _rectCommentText.size.height);
    
    return 50 + _rectCommentText.size.height;
}




- (void)create{
    
        //    用户头像
    self.imgVUser = [[UIImageView alloc]init];
    [self.contentView addSubview:_imgVUser];
    _imgVUser.frame =CGRectMake(20, 20, 30, 30);
    _imgVUser.layer.cornerRadius = 15;
    _imgVUser.layer.masksToBounds = YES;

       //    用户名
    self.labelUserName = [[UILabel alloc]init];
    [self.contentView addSubview:_labelUserName];
    _labelUserName.frame = CGRectMake(_imgVUser.frame.size.width + 20 + 20, 20, SCREENW -  _imgVUser.frame.size.width - 20 - 20 - 20, 30);

    
        //    段子内容
    self.labelText = [[UILabel alloc]init];
    [self.contentView addSubview:_labelText];
    _labelText.font = [UIFont systemFontOfSize:14];
    _labelText.numberOfLines = 100;
    
    
        //    种类按钮
    self.buttonKind = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:_buttonKind];
    _buttonKind.layer.cornerRadius = 10;
    _buttonKind.layer.borderColor = [UIColor colorWithRed:0.42 green:0.33 blue:0.28 alpha:1].CGColor;
    _buttonKind.layer.borderWidth = 0.5;
    [_buttonKind setTitleColor:[UIColor colorWithRed:0.42 green:0.33 blue:0.28 alpha:1] forState:UIControlStateNormal];
    _buttonKind.titleLabel.font = [UIFont systemFontOfSize:10];
    
//   ===============================================
    
    self.imageVMedia = [[UIImageView alloc]init];
    [self.contentView addSubview:_imageVMedia];
    
    
    self.bottomView = [[UIView alloc]init];
    _bottomView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
    [self.contentView addSubview:_bottomView];
    
    self.playButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _playButton.layer.cornerRadius = 25;
    _playButton.layer.borderColor = [UIColor whiteColor].CGColor;
    _playButton.layer.borderWidth = 0.5;
    [_playButton addTarget:self action:@selector(playButtonAction:) forControlEvents:UIControlEventTouchUpInside];

    _playButton.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
    
    [_playButton setImage:[UIImage imageNamed:@"iconfont-bofangqibofang-2.png"] forState:UIControlStateNormal ];
    [self.contentView addSubview:_playButton];
    
    
    self.playTimesLabel = [[UILabel alloc]init];
    _playTimesLabel.textColor = [UIColor whiteColor];
    _playTimesLabel.font = [UIFont systemFontOfSize:13];
    [_bottomView addSubview:_playTimesLabel];
    
    
    self.buttonFullScreen = [UIButton buttonWithType:UIButtonTypeCustom];
    [_buttonFullScreen setImage:[UIImage imageNamed:@"iconfont-quanping.png"] forState:UIControlStateNormal];
    
    [_buttonFullScreen addTarget:self action:@selector(buttonFullScreenAction:) forControlEvents:UIControlEventTouchUpInside];
    [_bottomView addSubview:_buttonFullScreen];

    
    self.timeRightLabel = [[UILabel alloc]init];
    
    _timeRightLabel.text = @"--:--";
    _timeRightLabel.textAlignment = NSTextAlignmentCenter;
    _timeRightLabel.textColor = [UIColor whiteColor];
    _timeRightLabel.textAlignment = NSTextAlignmentRight;
//    [_bottomView addSubview:_timeRightLabel];
    
    
//    ==================================================
    
   //    点赞按钮
    self.buttonZan = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:_buttonZan];
    [_buttonZan setImage:[UIImage imageNamed:@"RC32NLI__LBBJR]ET5I%D{5.png"] forState:UIControlStateNormal];



    self.labelZan = [[UILabel alloc]init];
    [self.contentView addSubview:_labelZan];
    _labelZan.font = [UIFont systemFontOfSize:12];
    _labelZan.textColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1];
   
    
    
    self.buttonLow = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview: _buttonLow];
    [_buttonLow setImage:[UIImage imageNamed:@"51FYKZ@K77SS}A0@{G_C]C7.png"] forState:UIControlStateNormal];

    
    self.labelLow = [[UILabel alloc]init];
    [self.contentView addSubview:_labelLow];
    _labelLow.font = [UIFont systemFontOfSize:12];
    _labelLow.textColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1];
    
    
    self.buttonHot = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:_buttonHot];
     [_buttonHot setImage:[UIImage imageNamed:@"LK@AF$6X){$X6E2WH3}5MUI.png"] forState:UIControlStateNormal];
    
    
    self.labelHot = [[UILabel alloc]init];
    [self.contentView addSubview:_labelHot];
    _labelHot.font = [UIFont systemFontOfSize:12];
    _labelHot.textColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1];
    
    //    如果评论数组不为空， 则创建评论tableView
//    if (_model.comments.count != 0 ) {
//        
//        [self createTableViewComment];
//        
//    }
//
    
//    self.myVedioPlayer = [MyVedioPlayer shareVedioPlayer];
//    [self.contentView addSubview:_myVedioPlayer.playView];
//
    
       self.myVedioPlayer = [MyVedioPlayer shareVedioPlayer];

}


- (void)playButtonAction:(UIButton *)button{
    
    _bottomView.hidden = YES;
    
        dispatch_async(dispatch_get_main_queue(), ^{
      [_myVedioPlayer setPlayViewWithframe:_rectVedio string:_model.origin_video[@"url_list"][0][@"url"]];
        });
        [_myVedioPlayer.bottomView addSubview:_buttonFullScreen];
    
        [self.contentView addSubview:_myVedioPlayer.playView];
    
    
}



- (void)buttonFullScreenAction:(UIButton *)button{
    
    
    MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:_model.origin_video[@"url_list"][0][@"url"]]];
    
//    for (UIView* next = [self superview]; next; next = next.superview) {
//        UIResponder* nextResponder = [next nextResponder];
//        if ([nextResponder isKindOfClass:[UIViewController class]]) {
//            UIViewController *vv = (UIViewController*)nextResponder;
//
//    
//    [vv presentViewController:moviePlayer animated:YES completion:nil];
//    
//        }
//    
//    }
    
//
////            [_myVedioPlayer.playView addSubview:_buttonFullScreen];
//    
//    if ([UIDevice currentDevice].orientation != UIDeviceOrientationPortrait) {
//        NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
//        [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
////        _bottom.hidden = NO;
////        _seg.hidden = NO;
////        _myVedioPlayer.playerLayer.frame = CGRectMake(0, 0, SCREENW, SCREENH / 2 - 70 * ht);
////        _myVedioPlayer.playView.frame = CGRectMake(0, 64, SCREENW, SCREENH / 2 - 70 * ht);
//        
//        _myVedioPlayer.playerLayer.frame = CGRectMake(0, 0, SCREENW, SCREENH);
//        
//        _bottomView.hidden = YES;
//        
//        
//        _myVedioPlayer.playerLayer.frame = CGRectMake(0, 0, _rectVedio.size.width, _rectVedio.size.height);
//        _myVedioPlayer.playView.frame = _rectVedio;
//        
//        [_myVedioPlayer.playView.layer insertSublayer:_myVedioPlayer.playerLayer atIndex:0];
//        
////        [self.contentView addSubview:_myVedioPlayer.playView];
//        
//        
////        self.bottomView.frame = CGRectMake(0, SCREEN_HEIGHT / 2 - 105 * ht, WIDTH, 35 * ht);
////        UIImageView *imageView = [_tableView viewWithTag:1000];
////        imageView.frame = CGRectMake(10 * wt, 5 * ht, 50 * wt, 50 * ht);
////        imageView.backgroundColor = [UIColor clearColor];
////        imageView.layer.cornerRadius = 25;
////        UILabel *name = [_tableView viewWithTag:2000];
////        name.frame = CGRectMake(65 * wt, 20 * ht, SCREEN_WIDTH / 2, 20 * ht);
////        UILabel *total = [_tableView viewWithTag:3000];
////        total.frame = CGRectMake(10 * wt, 60 * ht, SCREEN_WIDTH, 20 * ht);
////        UILabel *regData = [_tableView viewWithTag:4000];
////        regData.frame = CGRectMake(10 * wt, 85 * ht, SCREEN_WIDTH, 20 * ht);
////        self.playerLayer.frame =  CGRectMake(5, 5,[UIScreen mainScreen].bounds.size.width - 10,self.playView.frame.size.height -10);
////        
////        _play.frame = CGRectMake(20 * wt, 0, 30 * wt, 30 * ht);
////        
////        self.progressSlider.frame = CGRectMake(50 * wt, 0, WIDTH - 130 * wt, 30 * ht);
////        
////        self.timeLable.frame =CGRectMake(WIDTH - 80 * wt, 0, 80 * wt, 30 * ht);
////        [_fullButton setImage:[UIImage imageNamed:@"Full"] forState:(UIControlStateNormal)];
////        self.navigationController.navigationBarHidden = NO;
////        
////        self.fullButton.frame = CGRectMake(0, 5 , 20, 20);
////        _visualEfView.userInteractionEnabled = YES;
////        _backGroundImage.userInteractionEnabled = YES;
////        _tableView.alpha = 1;
////        _seg.hidden = NO;
//    }else {
//        NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
//        [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
//   
//        
//        NSLog(@"@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~");
//        
//        _bottomView.hidden = YES;
//        
//        CGRect rect = CGRectMake(0, 0, 667, 667);
//        
//        _myVedioPlayer.playView.frame = rect;
//        _myVedioPlayer.playerLayer.frame = CGRectMake(0, 0, _rectVedio.size.width * 667 / _rectVedio.size.height, 375);
//            [_myVedioPlayer.playView.layer insertSublayer:_myVedioPlayer.playerLayer atIndex:0];
////        [_myVedioPlayer setPlayViewWithframe:rect string:_model.origin_video[@"url_list"][0][@"url"]];
//        //        [self addSubview:_myVedioPlayer.playView];
//        
//        for (UIView* next = [self superview]; next; next = next.superview) {
//            UIResponder* nextResponder = [next nextResponder];
//            if ([nextResponder isKindOfClass:[UIViewController class]]) {
//                UIViewController *vv = (UIViewController*)nextResponder;
//                [vv.view addSubview:_myVedioPlayer.playView];
//            }
//        }
//        
//    
//        
////        [self.contentView addSubview:_myVedioPlayer.playView];
//
//        
//        
////        [_myVedioPlayer.playView addSubview:button];
//
//    
//        
//        
////        CGRect rect = CGRectMake(0, 64, SCREENW, SCREENH - 64);
//        
////        [_myVedioPlayer setPlayViewWithframe:_rectVedio string:_model.origin_video[@"url_list"][0][@"url"]];
//        
//        
////        
////        for (UIView* next = [self superview]; next; next = next.superview) {
////            UIResponder* nextResponder = [next nextResponder];
////            if ([nextResponder isKindOfClass:[UIViewController class]]) {
////                UIViewController *vv = (UIViewController*)nextResponder;
////                [vv.view addSubview:_myVedioPlayer.playView];
////            }
////        }
//        
//        
//        
////        [self addSubview:_myVedioPlayer.playView];
//        
////        _buttonFullScreen setImage:<#(nullable UIImage *)#> forState:<#(UIControlState)#>
////        _seg.hidden = YES;
////        _bottom.hidden = YES;
//
////        self.navigationController.navigationBarHidden = YES;
////        _myVedioPlayer.playView.frame = CGRectMake(0, 0, SCREENW, SCREENH);
////        _tableView.alpha = 0;
//        //全屏后底部处理
////        self.bottomView.frame = CGRectMake(0, SCREEN_HEIGHT * 5 / 6, SCREEN_WIDTH, SCREEN_HEIGHT / 6);
////        [_fullButton setImage:[UIImage imageNamed:@"ExFull"] forState:(UIControlStateNormal)];
//        
//        //全屏后的播放功能view
////        self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
//        //视频大小
////        self.playerLayer.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
//        //视频进度条 总时间 全屏按钮
////        self.play.frame = CGRectMake(25, 10, 50, 50);
////        self.progressSlider.frame = CGRectMake(10 + _play.frame.size.width + 10, 26, SCREEN_WIDTH - 20 - self.timeLable.frame.size.width - _play.frame.size.width - 100, 20);
////        self.timeLable.frame = CGRectMake(_play.frame.origin.x + 20 + _progressSlider.frame.size.width + 20 + 20, 12, 100, 50);
////        _fullButton.frame = CGRectMake(5 * wt, 45 * ht, 10 * wt, 30 * ht);
////        _visualEfView.userInteractionEnabled = YES;
////        _backGroundImage.userInteractionEnabled = YES;
//        
//    }
//
//    
//    
//    
//    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
